package org.xwb.springcloud.messagetype.simple;

import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.xwb.springcloud.constant.MqConstant;

/**
 * @author 10564
 */
@Component
public class SimpleConsumer {
    private static final Logger log = LoggerFactory.getLogger(SimpleConsumer.class);

    @RabbitListener(queues = MqConstant.SIMPLE_MQ_NAME)
    public void receiveHelloQueueMessage(String userModel, Channel channel) {
        log.info("\n简单消费者接收消息:{}\n", JSONObject.toJSONString(userModel));
    }
}
